<template>
	<view>
		<van-search @change="handleChanage"></van-search>
		<my-list-item v-for="(item, index) in listData" :key="index" :item="item"></my-list-item>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		debounce
	} from '../../utils/tool.js';
	const listData = ref([])
	const handleChanage = debounce(async (e) => {
		if(!e.detail) return 
		const resp = await uniCloud.database().collection('goodList').where(
			`${new RegExp(e.detail)}.test(title)`).get()
		console.log(resp.result.data)
		listData.value = resp.result.data
	})
</script>

<style lang="scss">

</style>